import request from '@/utils/request'
import Qs from 'qs'

// 设备状态
export function getEquipmentOtherData (params) {
  return request({
  params,
  url: '/back/equipmentOther/getData'
  })
}
// 开门,params
export function openDoor (data) {
    return request({
      method: 'post',
      params: data,
      url: '/back/equipmentMouth/openDoor'
    })
}
    // //开门,body
    // export function openDoor (data) {
    //   return request({
    //   method: 'post',
    //   data,
    //   url: '/back/equipmentMouth/openDoor'
    //   })
    // }


// 代理商列表
export function getManagerList (params) {
  return request({
      params,
      // url: 'back/manager/allList',
      url: 'back/manager/list',

  })
}

// 代理商列表
// export function getSubAgentsIds(params) {
//   return request({
//     params,
//     url: '/back/manager/getSubAgentsIds'
//   })
// }
// 设备列表
export function getEquipmentList (params) {
  return request({
  params,
  url: '/back/equipment/getBackEquipmentList'
  })
  }

  // 月租列表
export function getEstateMonthlyRent (params) {
  return request({
  params,
  url: '/back/equipment/getEstateMonthlyRent'
  })
  }
  // 格口列表
export function getEquipmentMouthList (params) {
  return request({
  params,
  url: '/back/equipmentMouth/getEquipmentMouthList'
  })
  }
  //开锁
export function openLock (data) {
    return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipmentMouth/openLock',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
    })
  }
    //复位
export function restoration (data) {
  return request({
  method: 'post',
  data:Qs.stringify(data),
  url: '/back/equipmentMouth/restoration',
  headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
  //查询更新 格口状态
export function queryStatus (data) {
  return request({
  method: 'post',
  data:Qs.stringify(data),
  url: '/back/equipmentMouth/queryStatus',
  headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}




// 新增设备
export function addtem (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipment/add',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

//删除设备
export function delEquipment (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipment/delete',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//修改设备
export function updateItem (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipment/update',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

 //更新设备状态
 export function getOneNetData (data) {
  return request({
  method: 'post',
  data:Qs.stringify(data),
  url: '/back/equipment/getOneNetData',
  headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}

 //更新设备状态
 export function updateIsFlag (data) {
  return request({
  method: 'post',
  data:Qs.stringify(data),
  url: '/back/equipment/updateIsFlag',
  headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}


//文件导入
export function addEquipmentExcel (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipment/addEquipmentExcel',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
// 文件模板下载
export function downLoadExcel (params) {
  return request({
    params,
    url: '/back/equipment/downLoadExcel?fileName=代理商-新增设备模板'
  })
}
//获取套餐详情
export function getEquipmentMeal (params) {
  return request({
    params,
    url: '/back/equipmentMeal/get'
  })
}
//添加套餐
export function addEquipmentMeal (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipmentMeal/add',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//修改套餐
export function updateEquipmentExcel (data) {
  return request({
    method: 'post',
    data,
    url: '/back/equipmentMeal/update',
    headers:{'content-type': 'application/json'}
  })
}
//批量修改套餐
export function addOrUpdateList (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipmentMeal/addOrUpdateList',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//添加设备卡套餐
export function addEquipmentCard (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/cardType/addCardType',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//修改设备卡套餐
export function updateEquipmentCard (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/cardType/updateCardType',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
// 批量修改设备卡套餐
export function addCardTypeList (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/cardType/addCardTypeList',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//删除设备卡套餐
export function delEquipmentCard (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/cardType/deleteCardType',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
  })
}
//查询设备卡
export function getEquipmentCardList (params) {
  return request({
    method: 'get',
    params,
    url: '/back/cardType/getCardTypeList'
  })
}
//喇叭开关命令
export function updateTrumpet (data) {
  return request({
    method: 'post',
    data:Qs.stringify(data),
    url: '/back/equipment/updateTrumpet',
    headers:{'content-type': 'application/x-www-form-urlencoded'}

  })
}

  //默认设备套餐参数
  export function addOrUpdate(data){
    return request({
    method:'post',
    data:Qs.stringify(data),
    url:'/back/systemParameter/equipmentMeal/addOrUpdate',
    headers:{'content-type': 'application/x-www-form-urlencoded'}
    })
  }




